package com.lq.ecoldchain.ui.register

import com.lq.ecoldchain.base.CommonLoadingViewModel
import org.kodein.di.Kodein
import org.kodein.di.android.support.AndroidLifecycleScope
import org.kodein.di.generic.bind
import org.kodein.di.generic.instance
import org.kodein.di.generic.scoped
import org.kodein.di.generic.singleton

/*
*2018/12/23 0023  18:03
*function by lq
*/
const val REGISTER_MODULE_TAG = "register_module_tag"

val registerModule  = Kodein.Module(REGISTER_MODULE_TAG) {

    bind<RegisterViewModel>() with scoped(AndroidLifecycleScope).singleton {
        RegisterViewModel()
    }

    bind<RegisterDelegate>() with scoped(AndroidLifecycleScope).singleton {
        RegisterDelegate(
                viewModel = instance(),
                loadingViewModel = CommonLoadingViewModel.instance(context)
        )
    }
}